<route lang="json5">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '指定任务人员',
    enablePullDownRefresh: true,
    navigationStyle: 'custom',
  },
}
</route>

<template>
  <page-meta :root-font-size="setting.rootFontSize"></page-meta>
  <view style="min-height: 100vh; background-color: #f2f2f1">
    <view style="position: sticky; top: 0; z-index: 9999">
      <wd-navbar title="指定任务人员" :bordered="false" safeAreaInsetTop>
        <template #left>
          <wd-icon name="thin-arrow-left" size="22px" color="white" @click="goBack"></wd-icon>
        </template>
        <!-- <template #right>
          <button>指定任务人员</button>
        </template> -->
      </wd-navbar>
    </view>
    <view style="flex: 1; overflow: auto">
      <th-card title="任务单信息">
        <th-form>
          <th-form-item label="任务编码">
            <text class="text">{{ form.projectCode }}</text>
          </th-form-item>
          <th-form-item label="任务名称">
            <text class="text">{{ form.projectName }}</text>
          </th-form-item>
          <view class="blocks" v-for="(item, index) in reviewPostList" :key="index">
            <view class="label">{{ item.documentsPostName }}</view>
            <view class="row" @click.prevent.stop="showSelectUser(item, index)">
              <template
                v-if="state[item.documentsPostCode] && state[item.documentsPostCode].length"
              >
                <wd-tag
                  style="
                    padding: 5rpx 10rpx;
                    font-size: 26rpx;
                    border-radius: 6rpx;
                    margin-right: 12rpx;
                    margin-bottom: 10rpx;
                  "
                  v-for="ite in state[item.documentsPostCode]"
                  :key="ite.value"
                  type="primary"
                >
                  {{ ite.personName }}
                </wd-tag>
              </template>
              <template v-else>
                <input
                  type="text"
                  :disabled="true"
                  v-model="state[item.documentsPostCode]"
                  :placeholder="'请选择' + item.documentsPostName"
                />
              </template>
            </view>
          </view>
          <!-- <th-form-item
            v-for="item in reviewPostList"
            :label="item.documentsPostName"
            class="form-demandDesc"
          >
            <view>
              <view class="row" @click.prevent.stop="showSelectUser(item)">
                <template v-if="selectList.length">
                  <wd-tag
                    style="padding: 5rpx 10rpx; font-size: 26rpx; border-radius: 6rpx"
                    v-for="ite in selectList"
                    :key="ite.value"
                    type="primary"
                  >
                    {{ ite.personName }}
                  </wd-tag>
                </template>
                <template v-else>
                  <input
                    type="text"
                    :disabled="true"
                    v-model="state[item.documentsPostCode]"
                    :placeholder="'请选择' + item.documentsPostName"
                  />
                </template>
              </view>
            </view>
          </th-form-item> -->

          <th-form-item label="预计完成时间" class="form-demandDesc">
            <uni-datetime-picker
              type="datetime"
              return-type="string"
              :border="false"
              v-model="state.userTime"
              placeholder="结束日期"
            />
          </th-form-item>
          <th-form-item label="说明" class="form-demandDesc">
            <textarea v-model="state.reason" style="border: 1px solid #f7f7f7"></textarea>
          </th-form-item>
        </th-form>
      </th-card>
    </view>
    <view class="flow-btn-fixed">
      <view class="btn_group" style="width: 100%">
        <view class="btn primary" @click="submit">保存</view>
      </view>
    </view>

    <leaguerPickerPm
      :show="selectUserShow"
      :filtration="true"
      :checked="state[currentType]"
      :nop="100"
      deptId="1805434119908089858"
      :returnDeptName="true"
      @hideModal="hideModal"
      @checkLeaguer="checkLeaguer"
    ></leaguerPickerPm>
  </view>
</template>

<script lang="ts" setup>
import { useSetting } from '@/stores/setting';
import { getObj, getPersonByPersonCode, updateByIdEvery, uploadSignature } from '@/service/pm-task';
import { formatByDayjs } from '@/utils/util';
import { useUserStore } from '@/stores/user';
import {
  selectrdDocumentsPostUser,
  selectrdDocumentsPostDict,
  updateSignHandle,
  getRdProjectUser,
  updateProjectUsers,
} from '@/service/pm-requirement';
const showTaskPop = () => {};
const setting = useSetting();
const userStore = useUserStore();
const showSign = ref(false);
const signature = ref('');
const userInfo = ref({});
const isChiefEngineer = ref('');
const isDeputyChiefEngineer = ref('');
const showAction = ref(false);
const postUserObj: any = ref({});
const rdProjectUserList = ref([]); // 签名列表
const currentIndex = ref([0]);
// 提交表单数据
const form = reactive({
  id: null,
  demandDate: null,
  personName: null,
  demandType: null,
  deptHead: null,
  deptCode: null,
  applicationType: null,
  samplesNum: null,
  demandDesc: null,
  sampleCoding: null,
  askCompleteTime: null,
  taskCode: null,
  userCode: null,
  invName: null,
  invDemand: null,
  sampleFlag: null,
  demandCode: null,
  cusName: null,
  personCode: null,
  deptHeadCode: null,
  cusFlag: '0',
  demandResult: null,
  completeTime: null,
  // technologyHead: null,
  remark: null,
  // technologyHeadCode: null,
  taskId: null,
  instanceId: null,
  invStd: null,
  sampleCode: null,
  sampleBatch: null,
  deptName: null,
  rdFlag: null,
  chiefEngineer: null,
  deputyChiefEngineer: null,
  status: null,
  sampleFlagName: null,
  deputyChiefEngineerUrl: null,
  chiefEngineerUrl: null,
  sampleUnit: null,
  cusCode: null,
  projectCode: null,
  projectName: null,
  rdProjectUser: null,
  projectHead: null,
  completionTime: null,
  // technologyHeadName: null,
  rdInformationDTO: [],
  rdCraftEntity: [],
  rdSampleAnalysisEntity: [],
  rdPlan: null,
  sampleReviewConclusion: null,
  requirements: null,
  projectHeadName: null,
  signedName: null,
  rdProjectUserEntity: [],
});
const loading = ref(false);
const init = (params) => {
  uni.$off('pm-requirement-sign');
  // selectrdDocumentsPostDictList();
  selectrdDocumentsPostDictLists();
  getUserList(params);
  uni.showLoading();
  getObj(params)
    .then((res) => {
      console.log('res', res);
      Object.assign(form, res.data);
      const rdDemandEntity = res.data.rdDemandEntity;
      if (rdDemandEntity) {
        const o: any = {};
        o.demandDate = rdDemandEntity.demandDate ? formatByDayjs(rdDemandEntity.demandDate) : '';
        o.askCompleteTime = rdDemandEntity.askCompleteTime
          ? formatByDayjs(rdDemandEntity.askCompleteTime)
          : '';
        o.demandCode = rdDemandEntity.demandCode;
        o.cusCode = rdDemandEntity.cusCode;
        o.deptName = rdDemandEntity.deptName;
        o.demandType = rdDemandEntity.demandType;
        o.deptCode = rdDemandEntity.deptCode;
        o.invName = rdDemandEntity.invName;
        o.invStd = rdDemandEntity.invStd;
        o.applicationType = rdDemandEntity.applicationType;
        o.invDemand = rdDemandEntity.invDemand;
        o.sampleFlagName = rdDemandEntity.sampleFlagName;
        o.sampleCode = rdDemandEntity.sampleCode;
        o.samplesNum = rdDemandEntity.samplesNum;
        o.sampleUnit = rdDemandEntity.sampleUnit;
        o.sampleBatch = rdDemandEntity.sampleBatch;
        // o.askCompleteTime = rdDemandEntity.askCompleteTime;
        o.demandDesc = rdDemandEntity.demandDesc;
        o.cusFlag = rdDemandEntity.cusFlag;
        o.sampleFlag = rdDemandEntity.sampleFlag;
        o.personName = rdDemandEntity.personName;

        Object.assign(form, o);
      }

      // analysisList.value = res.data.rdSampleAnalysisEntity;
      // const rdProject = [];
      const rdProject = [];
      res.data.rdProjectUserEntity.forEach((item: any) => {
        rdProject.push(item.userName);
      });
      form.rdProjectUser = rdProject.join(',');

      let rdInformationDTO = res.data.rdInformationDTO;
      rdInformationDTO = rdInformationDTO.map((item) => {
        const l = item.rdInformationProfileEntity;
        const rdInformationProfileEntity = [];
        l.forEach((rd) => {
          const profileType = rd.profileType;
          if (profileType == 'web') {
            item.informationWeb = rd.profileUrl;
          } else {
            rdInformationProfileEntity.push(rd);
          }
        });

        return {
          ...item,
          rdInformationProfileEntity: rdInformationProfileEntity,
        };
      });

      form.rdInformationDTO = rdInformationDTO;
    })
    .finally(() => {
      uni.stopPullDownRefresh();
      uni.hideLoading();
    });
  // checkPost();
  selectrdDocumentsPostUserFn();
};
const oldrdProjectUserEntity = ref([]);
const getUserList = (row) => {
  getRdProjectUser({
    demandCode: row.demandCode,
    rdCode: row.demandCode,
    // rdId: row.id,
    size: 1000,
  }).then((res) => {
    if (res.code === 0) {
      // Object.assign(form, res.data);
      // reviewPostList.value.filter((item) => item.chooseFlag == 1 && item.mainFlag != 1);
      const ll = res.data.records;

      const rdProjectUserEntity = [];
      ll.forEach((item) => {
        if (reviewPostList.value.find((r) => r.documentsPostCode == item.documentsPostCode)) {
          rdProjectUserEntity.push(item);
        }
      });

      const rdl = rdProjectUserEntity; // 获取所有选择的人员
      const lpost = [];
      rdl.forEach((item) => {
        if (!lpost.find((l) => l == item.documentsPostCode)) {
          lpost.push(item.documentsPostCode);
        }
      });

      lpost.forEach((l) => {
        const projectUser0 = rdProjectUserEntity.filter((item) => item.documentsPostCode == l);
        state.value[l] = projectUser0.map((item) => {
          return {
            personId: item.personId,
            userName: item.userName,
            userCode: item.userCode,
            personName: item.userName,
            personCode: item.userCode,
          };
        });
      });

      form.rdProjectUserEntity = rdProjectUserEntity.map((item) => {
        return {
          ...item,
          oldUserName: item.userName,
          oldUserCode: item.userCode,
        };
      });
      oldrdProjectUserEntity.value = rdProjectUserEntity.map((item) => {
        return {
          ...item,
          oldUserName: item.userName,
          oldUserCode: item.userCode,
        };
      });
      console.log(oldrdProjectUserEntity, 'oldrdProjectUserEntity');

      if (form.rdProjectUserEntity && form.rdProjectUserEntity.length) {
        const lu = form.rdProjectUserEntity.filter((item) => item.userTime);
        form.userTime =
          (lu && lu.length && lu[0]['userTime']) ||
          formatByDayjs(new Date(), 'YYYY-MM-DD HH:mm:ss');
      }
      console.log(form.rdProjectUserEntity, 'form.rdProjectUserEntity', oldrdProjectUserEntity);
    } else {
      uni.showToast({
        title: `${res.msg}`,
        icon: 'none',
      });
    }
  });
};
onLoad((options) => {
  const params = options.params;
  const obj = JSON.parse(params);

  init({
    id: obj.id,
    taskCode: obj.taskCode,
    demandCode: obj.demandCode,
  });
  getUserList({
    id: obj.id,
    taskCode: obj.taskCode,
    demandCode: obj.demandCode,
  });
});

const selectUserShow = ref(false);
const selectList = ref({});
const filterIsShow = ref(false);
const state = ref({});
const hideModal = () => {
  selectUserShow.value = false;
};
const currentType = ref('');
const currentList = ref('');
const current = ref({});
const showSelectUser = (item, index) => {
  console.log(item, 12321311111111111111111);
  currentType.value = item.documentsPostCode;
  current.value = item;
  // currentList.value = item.documentsPost;
  currentIndex.value = index;
  selectUserShow.value = true;
};
const handleClose = () => {
  filterIsShow.value = false;
};
onPullDownRefresh(() => {
  init({
    id: form.id,
    taskCode: form.taskCode,
    demandCode: form.demandCode,
  });
});

const goBack = () => {
  uni.navigateBack();
};

const preview = (url) => {
  if (!url) return;
  uni.previewImage({
    urls: [url],
  });
};

const closeSign = () => {
  showAction.value = false;
  uni.$off('pm-requirement-sign');
};

const signHanle = (sign) => {
  const userInfos: any = userInfo.value;
  // // 判断岗位
  // const _isChiefEngineer = isChiefEngineer.value;
  // const _isDeputyChiefEngineer = isDeputyChiefEngineer.value;

  // const params = {
  //   id: form.id,
  // };

  // if (!_isChiefEngineer && !_isDeputyChiefEngineer) {
  //   uni.showToast({
  //     title: '只有总工和副总工才能签字',
  //     icon: 'none',
  //   });
  //   return;
  // }

  // if (_isChiefEngineer) {
  //   // params['chiefEngineer'] = userInfos.id;
  //   params['chiefEngineer'] = userInfos.personCode;
  //   params['chiefEngineerName'] = userInfos.personName;
  //   params['chiefEngineerPost'] = _isChiefEngineer;
  //   params['chiefEngineerUrl'] = sign;
  // } else if (_isDeputyChiefEngineer) {
  //   params['deputyChiefEngineer'] = userInfos.personCode;
  //   params['deputyChiefEngineerName'] = userInfos.personName;
  //   params['deputyChiefEngineerPost'] = _isDeputyChiefEngineer;
  //   params['deputyChiefEngineerUrl'] = sign;
  // }

  console.log('postUserObj', postUserObj.value);
  const params = {
    demandCode: form.demandCode,
    taskCode: form.taskCode,
    personId: userInfos.id,
    userName: userInfos.personName,
    userCode: userInfos.personCode,
    userUrl: sign,
    // userType: postUserObj.value.documentsPostCode,
    documentsPostName: postUserObj.value.documentsPostName,
    documentsPostCode: postUserObj.value.documentsPostCode,
    documentsName: postUserObj.value.documentsName,
    documentsCode: postUserObj.value.documentsCode,
    signatureFlag: postUserObj.value.signatureFlag,
    reviewFlag: postUserObj.value.reviewFlag,
    rdCode: form.taskCode,
  };

  uni.showLoading({
    mask: true,
  });

  updateSignHandle(params)
    .then((res) => {
      if (res.code == 0) {
        uni.showToast({
          title: '签字成功',
        });

        // setTimeout(() => {
        //   uni.navigateBack();
        // }, 500);

        // 更新签字
        if (!signature.value) {
          uploadSignature({
            id: userInfos.id,
            signature: sign,
          });
        }
        showAction.value = false;
        // 刷新页面
        init({
          id: form.id,
          taskCode: form.taskCode,
          demandCode: form.demandCode,
        });
      } else {
        uni.showToast({
          mask: true,
          title: `签字失败,原因${res.msg}`,
          icon: 'none',
        });
      }
    })
    .finally(() => {
      uni.hideLoading();
      // uni.$off('pm-requirement-sign');
    });
};

const signThis = () => {
  const sign = signature.value;
  signHanle(sign);
};

const signReset = () => {
  uni.$on('pm-requirement-sign', (e) => {
    console.log('sign', e);
    signHanle(e);
  });
  uni.navigateTo({
    url: '/pages/pm/requirement/autograph',
  });
};

const previewImg = (url) => {
  if (!url) return;
  const urls = [];
  urls.push(url);
  console.log('url', urls);
  uni.previewImage({
    urls: urls,
    fail: (fail) => {
      console.log('fail', fail);
    },
  });
};

const previewFileHandle = (file) => {
  uni.navigateTo({
    url: '/pages/pm/preview-online?url=' + file,
  });
};

const previewWeb = (url) => {
  uni.navigateTo({
    url: '/pages/pm/preview-online?url=' + url + '&isWeb=1',
  });
};

const selectrdDocumentsPostDictList = async () => {
  try {
    const res = await selectrdDocumentsPostDict({
      webSql: `documents_code = '2'`,
      size: 1000,
    });
    if (res.code !== 0) {
      return;
    }
    console.log(res.data, 'rea.datataaaaaaaaa');

    rdProjectUserList.value = res.data.records;
  } catch (err) {
    console.log('err', err);
  }
};

const selectrdDocumentsPostUserFn = () => {
  const userInfos = userStore.userInfos;
  const cusPerson = userInfos.user.username;

  selectrdDocumentsPostUser({
    webSql: `user_code = '${cusPerson}' and documents_code = 2`,
    size: 1000,
  })
    .then((res) => {
      if (res.code == 0) {
        if (res.data.records.length) {
          const lrs = res.data.records.find(
            (item) => item.reviewFlag == 1 && item.signatureFlag == 1,
          );
          const lr = res.data.records.find((item) => item.reviewFlag == 1);
          const l = res.data.records;
          let o: any = {};

          if (lrs.length) {
            o = lrs[0];
          } else if (lr.length) {
            o = lr[0];
          } else {
            o = l[0];
          }
          postUserObj.value = o;
          if (o.reviewFlag == 1 || o.signatureFlag == 1) {
            showSign.value = true;
          } else {
            showSign.value = false;
          }
        } else {
          showSign.value = false;
        }
      } else {
        showSign.value = false;
      }
    })
    .catch(() => {
      showSign.value = false;
    });
};

// type 0 获取姓名 1 获取签名
const getProjectName = (item, type = 0) => {
  console.log(form.rdProjectUserEntity, item);
  const l = form.rdProjectUserEntity.filter((f) => f.userType == item.documentsPostCode);
  let s = '';
  if (l.length) {
    console.log('s', s);
    if (type == 0) {
      s = l.map((item) => item.userName).join(',');
      return s;
    } else {
      // s = l.map((item) => item.userUrl).join(',');
      s = l[0]['userUrl'];
      return s;
    }
  } else {
    return s;
  }
};

const reviewPostList = ref([]);

const selectrdDocumentsPostDictLists = async () => {
  try {
    const res = await selectrdDocumentsPostDict({
      webSql: `documents_code = '1'`,
      size: 1000,
    });
    if (res.code !== 0) {
      return;
    }
    reviewPostList.value = res.data.records.filter(
      (item) => item.chooseFlag == 1 && item.documentsPostCode != '123' && item.mainFlag == 0,
    );
    reviewPostList.value.forEach((item) => {
      if (!state.value[item.documentsPostCode]) {
        state.value[item.documentsPostCode] = [];
      }
      if (!state.value[item.documentsPost]) {
        state.value[item.documentsPost] = [];
      }
    });
  } catch (err) {
    // notification.error({
    //   message: '提示',
    //   // description: err.msg,
    //   description: err.msg || err.message || '获取字典列表失败',
    //   placement: 'bottomRight',
    // });
  }
};
const delPerson = ref([]);
const checkLeaguer = (e) => {
  if (e && e.length) {
    state.value[currentType.value] = e.map((item) => {
      return {
        personId: item.id,
        userName: item.personName,
        userCode: item.personCode,
        personName: item.personName,
        personCode: item.personCode,
      };
    });
    const delPersonIds = delPerson.value
      .filter((item) => item.documentsPostCode == currentType.value)
      .map((item) => item.userCode);
    const selectIds = e.map((item) => item.personCode);
    const rdProjectUserEntityList: any = [];
    const oldPersonIds = oldrdProjectUserEntity.value
      .filter((item) => item.documentsPostCode == currentType.value && item.delFlag == 0)
      .map((item) => item.userCode);
    const oldPerson = oldrdProjectUserEntity.value.filter(
      (item) => item.documentsPostCode == currentType.value && item.delFlag == 0,
    );

    e.filter((item) => !!item).forEach((item: any) => {
      if (delPersonIds.includes(item.personCode)) {
        const ii = delPerson.value.findIndex(
          (it) => it.documentsPostCode == currentType.value && it.usersCode == item.userCode,
        );
        delPerson.value.splice(ii, 1);
      }
      // const delIndex = delPersonIds.findIndex(ii=>item.personCode==i)
      // const o = defaultrdProjectUserList.value.find((i) => i.personId == item.id && i.documentsPostCode == row.documentsPostCode);
      if (!oldPersonIds.includes(item.personCode)) {
        rdProjectUserEntityList.push({
          // ...item,
          personId: item.id,
          userName: item.personName || item.userName,
          userCode: item.personCode || item.userCode,
          userType: currentType.value,
          documentsName: current.value.documentsName,
          documentsCode: current.value.documentsCode,
          documentsId: current.value.documentsId,
          documentsPostCode: current.value.documentsPostCode,
          documentsPostName: current.value.documentsPostName,
          processCode: 1,
          value: item.personCode,
          label: item.personName,
          // reviewFlag: o ? o.reviewFlag : row.reviewFlag,
          // signatureFlag: o ? o.signatureFlag : row.signatureFlag,
          reviewFlag: current.value.reviewFlag,
          signatureFlag: current.value.signatureFlag,
          chooseFlag: current.value.chooseFlag,
          updateType: '新增',
        });
      }
    });

    if (oldPerson.length) {
      oldPerson.map((item) => {
        const i = e.findIndex((it) => it.personCode == item.userCode);
        if (i < 0 && !delPersonIds.includes(item.userCode)) {
          item.userName = item.personName || item.userName;
          item.userCode = item.personCode || item.userCode;
          item.delFlag = 1;
          item.updateType = '删除';
          delPerson.value.push(item);
        }
      });
    }
    // if (oldrdProjectUserEntity.value && oldrdProjectUserEntity.value.length) {
    //   oldrdProjectUserEntity.value
    //     .filter((i) => i.documentsPostCode == currentType.value)
    //     .forEach((item, index) => {
    //       const i = form.rdProjectUserEntity
    //         .filter((ite) => ite.documentsPostCode == item.documentsPostCode)
    //         .findIndex((oi) => oi.userCode == (item.userCode || item.personCode));
    //       if (i < 0) {
    //         rdProjectUserEntityList.push({
    //           ...item,
    //           delFlag: 1,
    //           updateType: '删除',
    //         });
    //       }
    //     });
    // }
    //     .filter((f) => f.userType != currentType.value)
    form.rdProjectUserEntity = form.rdProjectUserEntity.concat(rdProjectUserEntityList);
  }
};
const submit = () => {
  if (delPerson.value.length) {
    //  form.rdProjectUserEntity.concat(delPerson.value)
    form.rdProjectUserEntity = [...form.rdProjectUserEntity, ...delPerson.value];
  }

  const params = form.rdProjectUserEntity.map((item) => {
    return {
      ...item,
      // id: form.id,
      demandCode: form.demandCode,
      userTime: state.value.userTime,
      reason: state.value.reason,
      rdCode: form.demandCode,
      rdId: form.id,
    };
  });
  if (loading.value == true) return;
  loading.value = true;
  updateProjectUsers(params)
    .then((res) => {
      console.log(res, 112);

      if (res.code === 0) {
        uni.showToast({
          title: `保存成功`,
          icon: 'none',
        });
        // emit('getData');
      } else {
        uni.showToast({
          title: res.msg,
          icon: 'none',
        });
      }
    })
    .catch((err) => {
      uni.showToast({
        title: err,
        icon: 'none',
      });
    })
    .finally(() => {
      loading.value = false;
    });
};
</script>

<style lang="scss" scoped>
.block .content {
  padding: 0 !important;
}

.card-detail {
  padding: 0 !important;
}

.wd-cell {
  padding-left: 0 !important;
}

.wd-card__title {
  border-left: 4px solid #2e5cf6 !important;
}

.pm-table {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0 30rpx;

  .pm-title {
    box-sizing: border-box;
    padding-left: 20rpx;
    margin: 40rpx 0;
    font-size: 32rpx;
    font-weight: bold;
    color: #333;
    border-left: 8rpx solid #2e5cf6;
    border-radius: 4rpx;
  }

  .pm-row {
    display: flex;
    min-height: 60rpx;
    border-bottom: 1px solid #f6f0f0;

    .pm-label {
      display: flex;
      align-items: center;
      width: 20%;
      font-size: 26rpx;
      color: #979494;
    }

    .pm-value {
      display: flex;
      flex: 1;
      align-items: center;
      font-size: 26rpx;
      color: #333;
    }
  }
}

.sign-main {
  // display: flex;
  // align-items: center;
  // justify-content: center;
  // width: 100%;
  // margin: 20rpx 0;
  position: fixed;
  right: 0rpx;
  bottom: 40rpx;
  width: 160rpx;
  height: 80rpx;
  line-height: 80rpx;
  color: white;
  text-align: center;
  background-color: rgb(77 128 240);

  // border-radius: 50%;
  border-top-left-radius: 40rpx;
  border-bottom-left-radius: 40rpx;
}

:deep(.label) {
  width: 160rpx !important;
}

.result-tag {
  padding: 6rpx 14rpx;
  margin: 2rpx 0;
  font-size: 24rpx;
  color: white;
  background-color: #87d068;
  border-radius: 4rpx;
}

.sign-main-show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .sign-main-show-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80rpx;
    margin-bottom: 20rpx;
    font-size: 30rpx;
    font-weight: bold;
    color: #818181;
    border-bottom: 1px solid #e3e3e3;
  }

  .sign-main-show-line {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    padding: 20rpx;
    margin: 20rpx 0;
    border: 4rpx solid #d0dbff;
    border-radius: 10rpx;
  }

  .sign-main-show-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80rpx;
    border-top: 1px solid #e3e3e3;
  }
}

.info-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.info-list-main {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10rpx;
  margin: 10rpx 0;
  border: 1px solid #e3e3e3;
  border-radius: 8rpx;

  .info-list-row {
    display: flex;
    width: 100%;

    .info-list-label {
      width: 150rpx;
      font-size: 28rpx;
      color: #808080;
    }

    .info-list-value {
      display: flex;
      flex: 1;
      align-items: center;
      width: 0;
      word-break: break-all;
      white-space: pre-line;
    }
  }
}

.craft-row {
  display: flex;
  align-items: center;

  .craft-row-img-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 0;
  }
}

.craft-row-img {
  width: 240rpx;
  height: 240rpx;
}

.form-demandDesc {
  align-items: flex-start !important;

  .text {
    word-break: break-all;
  }
}
.info-row-item {
  padding: 6rpx 0;
  word-break: break-all;

  // border-bottom: 1px solid #f2f2f2;
}

.text {
  word-break: break-all;
  word-wrap: break-word;
}

.flow-btn-fixed {
  width: 100%;
  background-color: white;
  border-top: 1px solid #f2f2f1;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

.btn_group {
  display: flex;
  justify-content: space-between;

  // margin: 0rpx 0 20rpx;
  // border-bottom: 1px solid #f2f2f1;

  .btn {
    display: flex;

    // width: 49%;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    // height: 40px;
    min-height: 40px;
    padding: 10rpx 0;
    font-size: 24rpx;
    color: black;

    // background-color: white !important;
    background-color: #dbecff !important;
    border-left: 1px solid #f7f7f7;
    border-radius: 0 !important;

    // color: white;
    border-radius: 6rpx;

    .btn-icon {
      width: 40rpx;
      height: 40rpx;
      margin-bottom: 8rpx;
    }
  }

  .danger {
    background-color: #f56c6c;
  }

  .primary {
    background-color: #409eff;
  }
}

:deep(.uni-date__x-input) {
  line-height: inherit;
  font-size: 14px;
  color: #999;
}

.blocks {
  display: flex;
  align-items: center;
  margin-top: 32rpx;
  margin: 0 26rpx;
  width: 100%;
  border-bottom: 1px solid #f7f7f7;
  .label {
    // margin-bottom: 20rpx;
    font-size: 14px;
    color: #666;
    // font-weight: bold;
  }

  .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex-wrap: wrap;
    padding: 20rpx;
    justify-content: space-between;
    :deep(.uni-date__x-input) {
      color: #666;
    }
    .date-picker {
      flex: 1;

      text-align: center;
      background-color: #f7f7f7;
      border-radius: 8rpx;
    }

    .select-box {
      flex: 1;

      // background-color: #f7f7f7;
      border-radius: 8rpx;

      :deep(.select-row) {
        padding: 0;
        background: none;
      }
    }

    input {
      flex: 1;
      height: 33rpx;
      padding: 0 12rpx;
      font-size: 26rpx !important;
      // background-color: #f7f7f7;
      // border: 1rpx solid #f7f7f7;
      border-radius: 8rpx;

      .input-placeholder {
        color: #8a929f;
      }
    }

    .btn {
      flex: 1;
      padding: 16rpx;
      color: #999;
      text-align: center;
      background-color: #f7f7f7;
      border: 1rpx solid #dedede;
      border-radius: 8rpx;

      ~ .btn {
        margin-left: 24rpx;
      }

      &.primary {
        color: #fff;
        background-color: #007aff;
        border-color: #007aff;
      }
    }
  }
}
</style>
